let questionnairList = [
    {
        "id": "0",
        "qname": "关于水果的问卷调查",
        "public": "公开",
        "anonymous": "记名",
        "start_time": "2020-04-01 10:00:00",
        "end_time": "2020-07-10 10:30:00",
        "State": '2',
        "questions":[
            {
                "qstype": '3',
                "qcontent": "第一部分"
            },
            {
                "qsid": '0',
                "qstype": '0',
                "qcontent": "您是否听说过XXX？",
                "options": ["听说过且了解", "仅听说过", "从未听说过"]
            },
            {
                "qsid": '1',
                "qstype": '1',
                "qcontent": "以下您喜欢的水果有哪些？",
                "options": ["西瓜", "桃子", "榴莲", "芒果"]
            },
            {
                "qstype": '3',
                "qcontent": "第二部分"
            },
            {
                "qsid": '2',
                "qstype": '2',
                "qcontent": "您对我们有什么建议？"
            }
        ]
    },
    {
        "id": "1",
        "qname": "对于XX的意见收集",
        "public": "公开",
        "anonymous": "记名",
        "start_time": "2020-04-02 11:00:00",
        "end_time": "2020-04-30 11:30:00",
        "State": '2',
        "questions":[
            {
                "qsid": '0',
                "qstype": '0',
                "qcontent": "您的性别？",
                "options": ["男", "女"]
            },
            {
                "qsid": '1',
                "qstype": '2',
                "qcontent": "您有哪些建议？",
            }
        ]
    },
    {
        "id": "2",
        "qname": "问卷三",
        "public": "非公开",
        "anonymous": "记名",
        "start_time": "2020-04-05 11:00:00",
        "end_time": "2020-04-20 11:30:00",
        "State": '1',
        "questions": []
    },
    {
        "id": "3",
        "qname": "问卷四",
        "public": "公开",
        "anonymous": "匿名",
        "start_time": "2020-04-06 11:00:00",
        "end_time": "2020-05-15 11:30:00",
        "State": '2',
        "questions": []
    },{
        "id": "4",
        "qname": "问卷五",
        "public": "非公开",
        "anonymous": "匿名",
        "start_time": "2020-04-02 16:00:00",
        "end_time": "2020-04-05 16:30:00",
        "State": '1',
        "questions": []
    },{
        "id": "5",
        "qname": "问卷六",
        "public": "公开",
        "anonymous": "记名",
        "start_time": "2020-06-30 16:00:00",
        "end_time": "2020-08-30 16:30:00",
        "State": '3',
        "questions": []
    },{
        "id": "6",
        "qname": "问卷七",
        "public": "非公开",
        "anonymous": "记名",
        "start_time": "2020-05-20 16:00:00",
        "end_time": "2020-05-25 16:00:00",
        "State": '4',
        "questions": []
    }
]

export default {
    'get|/getQuestionnairList': option => {
        return {
            status: 200,
            message: 'success',
            data: questionnairList
        }
    },
    'post|/getQuestionnair': option => {
        const questionnairId = JSON.parse(option.body).params.questionnair_id
        console.log(questionnairId)
        let returnData
        questionnairList.forEach(item => {
            if(item.id===questionnairId){
                returnData = item
            }
        })
        return {
            status: 200,
            message: 'success',
            data: returnData
        }
    },
    
}